<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="table-scrollable">
	<table class="table table-striped table-hover table-success">
		<thead>
			<tr>
				<th>#</th>
				<th>编号</th>
				<th>商品</th>
				<th>到达城市</th>
				<th>发件人</th>
				<th>收件人</th>
				<th>收件人地址</th>
				<th>收件人电话</th>
				<th>启动流程</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${list }" var="item" varStatus="vs">
				<tr>
					<td>${vs.count}</td>
					<td>${item.id }</td>
					<td>${item.product }</td>
					<td>${item.arrivecity }</td>
					<td>${item.sendername }</td>
					<td>${item.receivername }</td>
					<td>${item.receiveraddr }</td>
					<td>${item.receiverphone }</td>
					<td> 
						<a href="#" onclick="start(this,'${item.id}')" class="easyui-linkbutton" iconCls="icon-edit">
							<i class="glyphicon glyphicon-play"></i>
						</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>

<script type="text/javascript">
	
	function start(obj, id) {
		
		var url = "${webRoot}/workordermanage/start/"+id;
		var data = {};
		$.post(url, data, function(result){
			if(result.code == 0) {
				layer.msg("启动成功!", {shift: 1});
				setTimeout(function(){
					$(obj).parent().parent().remove();
				}, 1200);
				
			}else{
				layer.msg("启动失败!", {shift: 6});
			}
		})
	}

</script>
